package com.etc.delivery.service.driver;

import com.etc.delivery.dto.DriverDto;
import com.etc.delivery.entity.Driver;
import com.etc.delivery.entity.Warehouse;
import com.etc.delivery.entity.Waybill;
import com.github.pagehelper.PageInfo;

import javax.servlet.http.HttpSession;
import java.util.List;

public interface IDriverService1 {

    /**
     * 检查手机号是否存在
     *
     * @param phone
     * @return
     */
    public List<Driver> checkPhone(String phone);


    /**
     * 注册
     *
     * @param driver
     * @return
     */
    public boolean register(Driver driver);


    /**
     * 登录
     *
     * @param phone
     * @param password
     * @return
     */
    public List<Driver> DriverLogin(String phone, String password);


    /**
     * 查询所有订单
     *
     * @return
     */
    public List<Waybill> queryAllWaybill();


    /**
     * 分页查询所有订单
     *
     * @return
     */
    public PageInfo<Waybill> queryAllWaybillByPage(int pageNum, int pageSize, Integer warehouseId);

    public PageInfo<Waybill> queryAllWaybillByPage1(int pageNum, int pageSize, Integer warehouseId);

    /**
     * 根据手机号拿密码
     *
     * @param phone
     * @return
     */
    public String getPasswordByPhone(String phone);

    /**
     * 修改密码
     *
     * @param phone
     * @param newpassword
     * @return
     */
    public boolean modifyPassword(String phone, String newpassword);


    /**
     * 通过号码查询司机
     *
     * @return
     */
    public Driver queryDriverByPhone(String phone);


    /**
     * 修改司机资料
     *
     * @param
     * @return
     */
    public boolean modifyDriver(Driver driver);


    /**
     * 修改订单状态
     *
     * @param waybillNo
     * @return
     */
    public boolean modifyWaybillStatus(String waybillNo, Integer driverId, Integer warehouseId);

    public boolean modifyWaybillStatus1(String waybillNo, Integer driverId);


    /**
     * 根据运单状态分页查询 status=3
     *
     * @return
     */
    public PageInfo<Waybill> queryWaybillStatusByPage(int pageNum, int pageSize);

    /**
     * 根据运单状态查询 status=1
     *
     * @return
     */
    public PageInfo<Waybill> queryWaybillStatus1ByPage(int pageNum, int pageSize);

    /**
     * 分页查询司机接受订单
     *
     * @return
     */
    public PageInfo<Waybill> queryWaybillByDriverId(int pageNum, int pageSize, Integer id);

    public boolean arrived(String waybillNo);


    /**
     * 确认运单送达
     *
     * @param status
     * @return
     */
    public boolean changeDriverWaybillStatus(String status);

    public List<DriverDto> queryMyInfo(Integer id);

    public List<Warehouse> queryWareName();

    public String getPassword(String phone);

    public boolean checkEmail(String email, String phone);

}
